package org.sample.springboot.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GreetingController {

	private static final String TEMPLATE = "Hello, %s!";
	
	@RequestMapping("/greeting")
	public String greet(@RequestParam(value = "name", defaultValue = "World") String name) {
		
		return String.format(TEMPLATE, name);
	}
	
}
